package com.xb.controller;

import org.apache.shiro.authz.UnauthorizedException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author xbyan
 * @date 2023/7/8 0:49
 */
@ControllerAdvice
public class MyControllerAdvice {
    @ExceptionHandler(UnauthorizedException.class)
    public ModelAndView permission(Exception e){
        e.printStackTrace();
        return new ModelAndView("/errors/error");
    }
}
